package com.xjiye_test.payServer.serverletInit;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

/**
 * Created by Administrator on 2017/6/1.
 */
public class Config {

    public static Config getConfig() {
        return Config.ConfigHolder.INSTANCE.getConfig();
    }

    public static enum ConfigHolder{
        INSTANCE;

        private Config config;

        private ConfigHolder(){
            config=new Config();
            config.getPro();
        }

        public Config getConfig(){
            return config;
        }
    }

    private void  getPro(){
        Properties pro = new Properties();
        try {
            pro.load(this.getClass().getResourceAsStream("/shenma.properties"));
            wechat_payKey=pro.getProperty("wechat_payKey");
            shenmapay_cus_private_key=pro.getProperty("shenmapay_cus_private_key");
            shenmapay_cus_public_key=pro.getProperty("shenmapay_cus_public_key");
            ali_private_key=pro.getProperty("ali_private_key");
            ali_public_key=pro.getProperty("ali_public_key");
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }


    private String wechat_payKey;
    private String shenmapay_cus_private_key;
    private String shenmapay_cus_public_key;
    private String ali_private_key;
    private String ali_public_key;

    public String getWechat_payKey() {
        return wechat_payKey;
    }

    public String getShenmapay_cus_private_key() {
        return shenmapay_cus_private_key;
    }

    public String getShenmapay_cus_public_key() {
        return shenmapay_cus_public_key;
    }

    public String getAli_private_key() {
        return ali_private_key;
    }

    public String getAli_public_key() {
        return ali_public_key;
    }
}
